<template>
  <div>
    <div class="point-map-wrap">
      <popedom
        ref="pointMapRef"
        :actionType=actionType
        :ringsStr=ringsStr
        @polygonGraphic="polygonGraphic"
        @removeAll="removeAll"
      >
      </popedom>
    </div>
  </div>
</template>

<script>
  import popedom from "./popedom/popedom";
  export default {
    name: "popedomDev",
    components: {
      popedom
    },
    data(){
      return {
        point: [114.21868761726246, 30.584733852070247],
        actionType: '',   // 值为'edit'则是编辑point传入
        data:[],
        ringsStr: "",
        graphicAry:[]
      }
    },
    methods:{

      polygonGraphic(graphic){
        this.graphicAry.push(graphic) ;
        //console.log(graphic)
      },
      removeAll(){
        //console.log('removeAll');
      }
    },
    created(){
      let self = this;
      // setTimeout(function(){
      //   self.point = [ 114.22012005336887, 30.58153109697548 ];
      //   self.actionType = 'edit';
      // },1000);
    },
    watch:{
      SymbolColor(val){

        //console.log(this.colorRgb(val))
        //console.log(this.graphic)
        if(this.graphic){
          let colorAry = this.colorRgb(val);
          this.$refs.pointMapRef.changeColor(this.graphic,{r: colorAry[0], g: colorAry[1], b: colorAry[2], a: 0.5});
        }

      }
    }
  }
</script>

<style scoped>
  .point-map-wrap {
    width: 600px;
    height: 800px;
  }
  .form-ul {
    position: absolute;
    right: 0;
    top: 76px;
  }
</style>
